package GUItest;

public class DataBaseRunner {

	public static void main(String[] args) 
	{
		/*
		// Drop the tables
		handler.updateDateBase("DROP TABLE IF EXISTS `Transactions`;");
		handler.updateDateBase("DROP TABLE IF EXISTS `Accounts`;");
		handler.updateDateBase("DROP TABLE IF EXISTS `Loans`;");
		handler.updateDateBase("DROP TABLE IF EXISTS `Profile`;");
		handler.updateDateBase("DROP TABLE IF EXISTS `Users`;");
		
		// Create the tables
		handler.updateDateBase("CREATE TABLE `Users` (`id` BIGINT NULL AUTO_INCREMENT DEFAULT NULL,`Password` CHAR NULL DEFAULT NULL,PRIMARY KEY (`id`));");
		handler.updateDateBase("CREATE TABLE `Profile` (`id` BIGINT NULL AUTO_INCREMENT DEFAULT NULL,`LastName` CHAR NULL DEFAULT NULL,`FirstName` CHAR NULL DEFAULT NULL,`Address` CHAR NULL DEFAULT NULL,`SSN` CHAR NULL DEFAULT NULL,`PhoneNumber` CHAR NULL DEFAULT NULL,`Settings` CHAR NULL DEFAULT NULL,`Admin` bit NULL DEFAULT NULL,PRIMARY KEY (`id`));");
		handler.updateDateBase("CREATE TABLE `Loans` (`id` BIGINT NULL AUTO_INCREMENT DEFAULT NULL,`LoanId` BIGINT NULL DEFAULT NULL,`Amount` DOUBLE NULL DEFAULT NULL,`Interest` DOUBLE NULL DEFAULT NULL,`Balance` DOUBLE NULL DEFAULT NULL,`MinPay` DOUBLE NULL DEFAULT NULL,PRIMARY KEY (`id`));");
		handler.updateDateBase("CREATE TABLE `Accounts` (`id` BIGINT NULL AUTO_INCREMENT DEFAULT NULL,`AcctId` BIGINT NULL DEFAULT NULL,`Balance` DOUBLE NULL DEFAULT NULL,`Info` CHAR NULL DEFAULT NULL,`AcctName` CHAR NULL DEFAULT NULL,PRIMARY KEY (`id`));");
		handler.updateDateBase("CREATE TABLE `Transactions` (`AcctId` BIGINT NULL DEFAULT NULL,`Date` CHAR NULL DEFAULT NULL,`Amount` DOUBLE NULL DEFAULT NULL,`Transaction` CHAR NULL DEFAULT NULL,PRIMARY KEY (`AcctId`));");
		*/
		// Update Keys
		//handler.updateDateBase("ALTER TABLE `Users` ADD FOREIGN KEY (id) REFERENCES `Profile` (`id`);");
		//handler.updateDateBase("ALTER TABLE `Loans` ADD FOREIGN KEY (id) REFERENCES `Profile` (`id`);");
		//handler.updateDateBase("ALTER TABLE `Accounts` ADD FOREIGN KEY (id) REFERENCES `Profile` (`id`);");
		//handler.updateDateBase("ALTER TABLE `Transactions` ADD FOREIGN KEY (AcctId) REFERENCES `Accounts` (`AcctId`);");
		
		//handler.updateDateBase("UPDATE course SET meeting_Time = '10:20' WHERE instructor = 5 && course_Num = 346;" );
		//String[][] results = handler.query("SELECT office FROM faculty;", 1);
		//String[][] results = handler.query("SELECT meeting_Time, meeting_Building FROM course WHERE instructor = 5;", 2,2);
		
		//String[][] results = handler.query("SELECT first_name FROM faculty WHERE id = 4;", 1, 1);
		/*for(int i = 0; i < results.length; i++)
		{
			for(int j = 0; j < results[i].length; j++)
				System.out.println(results[i][j]);
		}
		*/

	}

}
